#!/bin/bash

# 宝塔定时任务添加，每天分钟 执行：sudo -uwww /www/wwwroot/api/shell/prod/1min.sh

# 日志目录，没有就创建
dirname=/www/wwwlogs/api/`date +'%Y-%m'`
if [ ! -d $dirname ]; then
    mkdir -p $dirname
fi

filename=${dirname}/`date +'%d'`-1min



# 话费下单到供应商: k10乐充
# php /www/wwwroot/api/think mobile:createSupplierOrder --supplierCode lechong >> ${filename}-createSupplierOrder-lechong.log 2>&1 &

# 话费下单到供应商: 椰子k30m
# php /www/wwwroot/api/think mobile:createSupplierOrder --supplierCode xyzshops-30 >> ${filename}-createSupplierOrder-xyzshops-30.log 2>&1 &

# 话费下单到供应商: 椰子k6h
# php /www/wwwroot/api/think mobile:createSupplierOrder --supplierCode xyzshops >> ${filename}-createSupplierOrder-xyzshops.log 2>&1 &

# 话费下单到供应商: 椰子慢24h
# php /www/wwwroot/api/think mobile:createSupplierOrder --supplierCode xyzshops-m24h >> ${filename}-createSupplierOrder-xyzshops-m24h.log 2>&1 &

# 话费下单到供应商: k直充万图拍
php /www/wwwroot/api/think mobile:createSupplierOrder --supplierCode nianyu-9999 >> ${filename}-createSupplierOrder-nianyu-9999.log 2>&1 &

# 话费下单到供应商: 36鲸
php /www/wwwroot/api/think mobile:createSupplierOrder --supplierCode duojing36 >> ${filename}-createSupplierOrder-duojing36.log 2>&1 &

# 话费下单到供应商: 36鲸新
php /www/wwwroot/api/think mobile:createSupplierOrder --supplierCode jing36 >> ${filename}-createSupplierOrder-jing36.log 2>&1 &


# 话费下单到供应商: 南京硅通
# php /www/wwwroot/api/think mobile:createSupplierOrder --supplierCode guitong >> ${filename}-createSupplierOrder-guitong.log 2>&1 &



# 话费充值订单轮询
php /www/wwwroot/api/think mobile:reOrder >> ${filename}-mobile-reOrder.log 2>&1 &

# 话费状态变更回调通知代理商
php /www/wwwroot/api/think mobile:notifyAgent >> ${filename}-mobile-notifyAgent.log 2>&1 &

# 话费充值失败退款
php /www/wwwroot/api/think mobile:autoRefund >> ${filename}-mobile-autoRefund.log 2>&1 &


# 乐充订单状态查询
php /www/wwwroot/api/think querylechong >> ${filename}-querylechong.log 2>&1 &

wait
